package com.yixun.qfbao.hander;

import com.yixun.qfbao.api.service.AssistantReportService;
import com.yixun.qfbao.apidto.AssistantReportPageReqDto;
import com.yixun.qfbao.apidto.AssistantReportPageResDto;
import com.yixun.qfbao.dto.base.BaseRequestDTO;
import com.yixun.qfbao.dto.base.BaseResponseDTO;
import com.yixun.qfbao.hander.base.CommonAbstractHander;
import com.yixun.qfbao.service.PartnerInfoService;
import com.yixun.qfbao.vo.AssistantReportPageReqVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("getAssistantAppReportPageHander")
public class GetAssistantAppReportPageHander extends CommonAbstractHander {
	private static Logger logger= LoggerFactory.getLogger(GetAssistantAppReportPageHander.class);

	@Autowired
	PartnerInfoService partnerInfoService;
	@Autowired
	private AssistantReportService assistantReportService;

	@SuppressWarnings("rawtypes")
	@Override
	public BaseResponseDTO doBusiness(BaseRequestDTO reqDto) {
		AssistantReportPageReqVo req = (AssistantReportPageReqVo)reqDto;
		AssistantReportPageReqDto reqDto1 = req.getParams();
		BaseResponseDTO<AssistantReportPageResDto> res = new BaseResponseDTO<>();
		AssistantReportPageResDto resDto = new AssistantReportPageResDto();
		try {
			resDto = assistantReportService.getAssistantAppReportPage(reqDto1);
		} catch (Exception e) {
			logger.error("巧渠道报备列表,获取失败, getAssistantAppReportPageHander error: {}", e);
			resDto.setResultMsg("巧报备列表,获取失败," + e.getMessage());
		}
		res.setResData(resDto);
		res.setResult(resDto.getResult());
		res.setErrorMsg(resDto.getResultMsg());
		return res;
	}
	
}
